{% macro gen_form(form, form_route, can_export, current_user) %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

    <form id="search-demand-form" action="{{ url_for(form_route) }}" method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.user_phone, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.id, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.uid, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.prov, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.cate, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.malf, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.type, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.surr, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.color, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.status, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.tag, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.source, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.admin_id, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.has_audio, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.robot_win, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        {{ my_wtf_macros.form_field(form.created_at_begin, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.created_at_end, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        {{ my_wtf_macros.form_field(form.published_at_begin, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.published_at_end, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.is_for_gold, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        {{ my_wtf_macros.form_field(form.remark, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.admin_remark, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.ignore_invalid, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-demand-btn">
                查询
            </button>
            {% if can_export and not current_user.is_agent %}
                <a
                    href="javascript:void(0);"
                    target="_blank"
                    class="btn-group btn btn-primary"
                    id="export-demands"
                >
                    导出
                </a>
            {% endif %}
        </div>
    </form>
{% endmacro %}
